# -*- coding: utf-8 -*-
"""
Created on 16-1-7 下午3:22
@File: p2p.py
@Author: Liangrong Li
@Contact: liliangrong0@126.com
@Description: 
"""


if __name__ == '__main__':
    import urllib2
    import time
    import json
    start = time.clock()

    url = "http://www.caimiao.cn/rating/rankAjax/"
    html = urllib2.urlopen(url)
    data = json.loads(html.read())
    next_page = data['page']
    content = data['content']
    print next_page.encode('gb2312', 'ignore')
    for c in content:
        print c['platform_name'].encode('gb2312', 'ignore'), ' : ', c['website']

    end = time.clock()
    print "run time is %f s" % (end-start)